package com.eddie.hhcook.qqapi;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import com.eddie.hhcook.PersonCenterActivity;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.UiError;

/**
 * Created by htj-123 on 2015/7/28.
 */
public class QQIUiListener implements IUiListener {

    private Activity context;
    public QQIUiListener(Activity context){
        this.context = context;
    }

    @Override
    public void onComplete(Object response) {
        QQAccessTokenKeeper.writeAccessToken(context, response);
        context.finish();
        context.startActivity(new Intent(context, PersonCenterActivity.class));
    }

    @Override
    public void onError(UiError uiError) {

    }

    @Override
    public void onCancel() {

    }
}
